Example of how to use the decode function in oracle, oracledecode
Decode usage
1: Use decode to determine whether the string is the same
DECODE (value, if1, then1, if2, then2, if3, then3,..., else)
Meaning:IF condition = value 1 THENRETURN (value 1)
The Decode function is an Oracle Pl/sql is one of the powerful functions, and currently only Oracle company SQL provides this function, other database vendors do not have the SQL implementation. What is the use of decode? To construct an example,
Original address: http://www.cnblogs.com/BetterWF/archive/2012/06/12/2545829.htmlReproduced in reserveCompare size function Signfunction Syntax:Sign (n)Function Description:Take the sign of the number n, greater than 0 returns 1, less than 0 returns-
The decode () function is one of the powerful functions of Oracle Pl/sql, and it is currently available only in Oracle company SQL, and not in the SQL implementations of other database vendors. (But it's not a standard SQL function, but that's his
Oracle decode functions are very powerful, and here's a detailed description of the use of the Oracle decode function, hopefully giving you a better understanding of Oracle decode functions.
Oracle decode functionsThe Oracle decode function is an
Compare size function Sign
function Syntax:Sign (n)
Function Description:Take the symbol of number n, greater than 0 to return 1, less than 0 to return-1, equal to 0 to return 0
Example:One, select sign (m), sign (-M), sign (0) from dual;
SIGN (+)
Decode Function usage:
OracleOfDecodeThe function is quite interesting.OracleExclusive, International StandardSQLNot inDecodeFunction.
Syntax
Decode (Col | expression, search1, result1
[, Search2, result2 ,...,]
[, Default])
Example
Look at other people's SQL today look at this inside there are also decode () function, has never been in contact with the Internet to check a bit, but also very useful for a function, write down hope to help friends Ah!Introduction to the Decode ()
Introduction to the Decode () function in SQLLook at other people's SQL today look at this inside there are also decode () function, has never been in contact with the Internet to check a bit, but also very useful for a function, write down hope to
Decode function: It can compare an input value to a parameter list in a function, and return a corresponding value based on the input value. The parameter list of a function is a number of sequential pairs of numbers and their corresponding result
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.